from rest_framework.serializers import ModelSerializer
from django.contrib.auth.models import Group
from django.contrib.auth.models import Permission

class GroupModelSerializer(ModelSerializer):
    """组权限序列化器"""

    class Meta:
        model= Group
        fields='__all__'


class PermissionModelSerializer(ModelSerializer):
    """权限类型序列化器"""

    class Meta:
        model= Permission
        fields=('id','name')


